<template>
  <view class="container">
    <view class="result-icon">
      <image v-if="status === 'success'" src="/static/success.png" mode="aspectFit"></image>
      <image v-else src="/static/fail.png" mode="aspectFit"></image>
    </view>
    
    <view class="result-title">
      <text v-if="status === 'success'">支付成功</text>
      <text v-else>支付失败</text>
    </view>
    
    <view class="result-info">
      <view class="info-item">
        <text class="label">订单号：</text>
        <text class="value">{{ orderNo }}</text>
      </view>
    </view>
    
    <view class="btn-group">
      <button class="btn" type="default" @click="goHome">返回首页</button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      status: 'success',
      orderNo: ''
    }
  },
  onLoad(options) {
    if (options.status) {
      this.status = options.status
    }
    if (options.orderNo) {
      this.orderNo = options.orderNo
    }
  },
  methods: {
    goHome() {
      uni.reLaunch({
        url: '/pages/index/index'
      })
    }
  }
}
</script>

<style>
.container {
  padding: 50rpx 30rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-icon {
  margin-bottom: 30rpx;
}

.result-icon image {
  width: 150rpx;
  height: 150rpx;
}

.result-title {
  font-size: 40rpx;
  font-weight: bold;
  margin-bottom: 50rpx;
}

.result-title text {
  color: #333;
}

.result-info {
  width: 100%;
  margin-bottom: 80rpx;
}

.info-item {
  display: flex;
  padding: 20rpx 0;
  border-bottom: 1px solid #eee;
}

.label {
  color: #666;
  font-size: 28rpx;
  width: 150rpx;
}

.value {
  flex: 1;
  font-size: 28rpx;
  color: #333;
}

.btn-group {
  width: 100%;
  margin-top: 50rpx;
}

.btn {
  width: 90%;
  margin-bottom: 20rpx;
}
</style> 